<?php

use Illuminate\Database\Seeder;

class premisstable extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //



        $huangsen  = \App\User::find(1);

        $admin = \App\Models\Admin\Role::create([
            'name'=>'admin',
            'display_name'=>'管理员',
            'description'=>'super man role'
        ]);

        $permission = \App\Models\Admin\Permission::create([
            'name'=>'manager_user',
            'display_name'=>'管理用户',
            'description'=>'管理用户的权限'
        ]);
        //给角色付权限
        $admin->attachPermission($permission);

        //给用户赋予角色
        $huangsen->attachRole($admin);

    }
}
